<script type="text/javascript">
$(function(){
	$.get("applicationSingle/getCardInfo",function(item){
		var contentb="<option value=''>请选择</option>";
		var contenta="<option value=''>请选择</option>";
		if(item.cdPhysicsTypes!=null&&item.cdProDefinitions!=null){
			for(i=0;i<item.cdPhysicsTypes.length;i++){
				contenta+="<option value="+item.cdPhysicsTypes[i].cardTypeCode+">"
				+item.cdPhysicsTypes[i].cardTypeName+"</option>"	
			}
			for(i=0;i<item.cdProDefinitions.length;i++){
				if(item.cdProDefinitions[i].cardTypeCode=="2"){
					contentb+="<option value="+item.cdProDefinitions[i].cardpCode+">"
					+item.cdProDefinitions[i].cardpName+"</option>"	
				}
						
			}
		}
		$("#cardPCodeByFileTemplate").html(contentb);
		$("#cardPhysicalTypeByFileTemplate").html(contenta);
	},"json");
});
function exportFileTemplate(){
	var cardPCode=$("#cardPCodeByFileTemplate").val();
	var cardPhysicalType=$("#cardPhysicalTypeByFileTemplate").val();
	if(cardPCode!=""&&cardPhysicalType!=""){
		$.post("applicationBatch/exportTemplate",{cardPCode:cardPCode,cardPhysicalType:cardPhysicalType},function(json){
			if(json.statusCode==DWZ.statusCode.error){
				navTabAjaxDone(json);
			}else{
				window.location.href=json.serviceObject.str
				alertMsg.correct("模板生成成功,路径\n"+json.serviceObject.str)
			}
		},"json");
	}else{
		alertMsg.info('卡产品，卡物理类型不能为空');
	}
	return false;
}
</script>
<div class="pageContent">
	<form method="post" action="" class="pageForm required-validate" onsubmit="return formSubmit(this);">
		<div class="pageFormContent" layoutH="56">
			
			<p>
				<label>卡产品：</label>
				<select id="cardPCodeByFileTemplate" name="cardPCode" class="">
				
				</select>
			</P>
			<p>
				<label>卡物理类型：</label>
				<select id="cardPhysicalTypeByFileTemplate" name="cardPhysicalType" class="required">
				
				</select>
			</P>
			 <a class="button"  href="#" onclick="return exportFileTemplate();" ><span>生成空白模板</span></a><br /><br />
			 </div>
	</form>
</div>